public class GoodsTest {
    public static void main(String[] args) {
        Goods[] arr = new Goods[3];
        Goods g1 = new Goods("001", "苹果", 37.1, 100);
        Goods g2 = new Goods("002", "香蕉", 7.1, 870);
        Goods g3 = new Goods("003", "西瓜", 374.1, 400);
        arr[0] = g1;
        arr[1] = g2;
        arr[2] = g3;
        // 遍历数组
        for (int i = 0; i<arr.length; i++){
             Goods goods = arr[i];
             System.out.println("id:" + goods.getId() + " name:" + goods.getName() + " price:" + goods.getPrice() + " count:" + goods.getCount());
        }
    }


}
